home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / dev / misc / WHDLoadusr.lha / WHDLoad / Install < prev    next >
Text File  |  1997-08-05  |  3KB  |  136 lines

  1. ;----------------------------
  2. ; Check version and install if newer
  3. ; IN:    #source-file
  4. ;    #dest-file
  5.  
  6. (procedure P_install
  7.   (if
  8.     (exists #dest-file)
  9.     (
  10.       (set #sver (getversion #source-file))
  11.       (set #dver (getversion #dest-file))
  12.       (if
  13.         (>= #sver #dver)
  14.         (
  15.           (if
  16.             (= @user-level 2)
  17.             (set #choice
  18.               (askbool
  19.                 (prompt ("\nInstalling\n\n\"%s\" Version %ld.%ld\n\nover\n\n\"%s\" Version %ld.%ld" (fileonly #source-file) (/ #sver 65536) (BITAND #sver 65535) #dest-file (/ #dver 65536) (BITAND #dver 65535)))
  20.                 (default 1)
  21.                 (choices "Install" "Skip")
  22.                 (help @askbool-help)
  23.               )
  24.             )
  25.             (set #choice 1)
  26.           )
  27.         )
  28.         (set #choice 0)
  29.       )
  30.     )
  31.     (set #choice 1)
  32.   )
  33.   (if
  34.     (= #choice 1)
  35.     (copyfiles
  36.       (help @copyfiles-help)
  37.       (source #source-file)
  38.       (dest (pathonly #dest-file))
  39.       (newname (fileonly #dest-file))
  40.     )
  41.   )
  42. )
  43.  
  44. ;----------------------------
  45.  
  46. (set @default-dest
  47.   (askdir
  48.     (prompt ("Where should %s and the other tools installed ?\nThe location must be reachable via the path !\nRecommend is \"C:\"." @app-name))
  49.     (help @askdir-help)
  50.     (default "C:")
  51.     (disk)
  52.   )
  53. )
  54.  
  55. (set #path "c")
  56. (foreach #path "#?"
  57.   (set #file @each-name)
  58.   (set #source-file (tackon #path #file))
  59.   (set #dest-file   (tackon @default-dest #file))
  60.   (P_install)
  61. )
  62.  
  63. (if
  64.   (exists "c/InstallBB")
  65.   (
  66.     (set #dest
  67.       (askdir
  68.         (prompt "Where should \"whdload.i\" installed ?")
  69.         (help @askdir-help)
  70.         (default "Includes:")
  71.       )
  72.     )
  73.     (copyfiles
  74.       (help @copyfiles-help)
  75.       (source "include/whdload.i")
  76.       (dest #dest)
  77.     )
  78.     (set #dest
  79.       (askdir
  80.         (prompt "Where should \"whdload.doc\" installed ?")
  81.         (help @askdir-help)
  82.         (default "Autodocs:")
  83.       )
  84.     )
  85.     (copyfiles
  86.       (help @copyfiles-help)
  87.       (source "autodoc/whdload.doc")
  88.       (dest #dest)
  89.     )
  90.     (exit
  91.       "\n"
  92.       "Installation is so far complete.\n"
  93.       "Now you should move this installation drawer to a persistent place. And examine it. "
  94.       "Take a look at the \"src\" directory and don't forget to read the "
  95.       "Guide the autodoc ...\n"
  96.       "\n"
  97.       "Hope it will be useful for you.\n"
  98.       (quiet)
  99.     )
  100.   )
  101.   (
  102.     (set #dest
  103.       (askdir
  104.         (prompt "Where should \"WHDLoad.guide\" installed ?")
  105.         (help @askdir-help)
  106.         (default "Help:")
  107.       )
  108.     )
  109.     (copyfiles
  110.       (help @copyfiles-help)
  111.       (source "Docs/WHDLoad.guide")
  112.       (dest #dest)
  113.     )
  114.     (set #dest
  115.       (askdir
  116.         (prompt "Where should \"Patcher.Readme\" installed ?")
  117.         (help @askdir-help)
  118.         (default #dest)
  119.       )
  120.     )
  121.     (copyfiles
  122.       (help @copyfiles-help)
  123.       (source "Docs/Patcher.Readme")
  124.       (dest #dest)
  125.     )
  126.     (exit
  127.       "\n"
  128.       "Installation is now complete.\n"
  129.       "Please read the documentation carefully how to use and configure WHDLoad for your needs.\n"
  130.       (quiet)
  131.     )
  132.   )
  133. )
  134.  
  135.  
  136.